<?php
namespace app\common\model;

use think\Model;

class CompanyStaffDepart extends Model
{
	protected function setEntryTimeAttr($v)
	{
		return $v ? strtotime($v) : $v;
	}
	protected function setLeaveTimeAttr($v)
	{
		return $v ? strtotime($v) : $v;
	}
	protected function getDepartNameAttr($v,$d)
	{
		return CompanyDepartment::get($d['depart_id'])->depart_name;
	}
	protected function getPostNameAttr($v,$d)
	{
		return CompanyJobpost::get($d['post_id'])->post_name;
	}
	protected function getEntryTimeAttr($v){
		return $v ? date('Y-m-d',$v) : '-';
	}
	protected function getLeaveTimeAttr($v){
		return $v ? date('Y-m-d',$v) : '';
	}
}